package com.qixin.activiti.listenter;

import com.qixin.activiti.listenter.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.activiti.engine.delegate.DelegateExecution;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.modules.system.vo.ActivitiVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @Description: TODO
 * @author: CYS
 * @date: 2022年02月16日 15:34
 */
@Api(tags="NC报销推送NC报销审批通过接口")
@Slf4j
@RestController
@RequestMapping("/system/listenter")
public class NCTestController {

    @Autowired
    private EaTravelExecutionListener eaTravelExecutionListener;
    @Autowired
    private EaCommunicationsExecutionListener eaCommunicationsExecutionListener;
    @Autowired
    private EaPaymentExecutionListener eaPaymentExecutionListener;
    @Autowired
    private EaLoanbillExecutionListener eaLoanbillExecutionListener;
    @Autowired
    private EaEntertainExecutionListener eaEntertainExecutionListener;
    @Autowired
    private EaRepaymentbillExecutionListener eaRepaymentbillExecutionListener;

    /***
    * @Description: TODO
    * @author: CYS
    * @date: 2022/2/16 15:39
    * @param :
    * @Return: void
    */
    @AutoLog(value = "差旅费报销推送NC报销审批通过接口")
    @ApiOperation(value="差旅费报销推送NC报销审批通过接口", notes="差旅费报销推送NC报销审批通过接口")
    @RequestMapping(value = "/travelExpenseBX", method = RequestMethod.POST)
    public Result travelExpenseBX() {
        DelegateExecution delegateExecution=null;
        try {
            eaTravelExecutionListener.notify(delegateExecution);
        } catch (Exception e) {
            return Result.error(e.getMessage());
        }
        return  Result.ok("success");
    }

    /***
     * @Description: TODO
     * @author: CYS
     * @date: 2022/2/16 15:39
     * @param :
     * @Return: void
     */
    @AutoLog(value = "通讯费报销推送NC报销审批通过接口")
    @ApiOperation(value="通讯费报销推送NC报销审批通过接口", notes="通讯费报销推送NC报销审批通过接口")
    @RequestMapping(value = "/communicationExpenseBX", method = RequestMethod.POST)
    public Result communicationExpenseBX() {
        DelegateExecution delegateExecution=null;
        try {
            eaCommunicationsExecutionListener.notify(delegateExecution);
        } catch (Exception e) {
            return Result.error(e.getMessage());
        }
        return  Result.ok("success");
    }

    /***
     * @Description: TODO
     * @author: CYS
     * @date: 2022/2/16 15:39
     * @param :
     * @Return: void
     */
    @AutoLog(value = "招待报销推送NC报销审批通过接口")
    @ApiOperation(value="招待报销推送NC报销审批通过接口", notes="招待报销推送NC报销审批通过接口")
    @RequestMapping(value = "/serveExpenseBX", method = RequestMethod.POST)
    public Result serveExpenseBX() {
        DelegateExecution delegateExecution=null;
        try {
            eaEntertainExecutionListener.notify(delegateExecution);
        } catch (Exception e) {
            return Result.error(e.getMessage());
        }
        return  Result.ok("success");
    }
    /***
     * @Description: TODO
     * @author: CYS
     * @date: 2022/2/16 15:39
     * @param :
     * @Return: void
     */
    @AutoLog(value = "资金审批单报销推送NC报销审批通过接口")
    @ApiOperation(value="资金审批单报销推送NC报销审批通过接口", notes="资金审批单报销推送NC报销审批通过接口")
    @RequestMapping(value = "/cashPaymentBill", method = RequestMethod.POST)
    public Result cashPaymentBill() {
        DelegateExecution delegateExecution=null;
        try {
            eaPaymentExecutionListener.notify(delegateExecution);
        } catch (Exception e) {
            return Result.error(e.getMessage());
        }
        return  Result.ok("success");
    }

    /***
     * @Description: TODO
     * @author: CYS
     * @date: 2022/2/16 15:39
     * @param :
     * @Return: void
     */
    @AutoLog(value = "借款单报销推送NC报销审批通过接口")
    @ApiOperation(value="借款单报销推送NC报销审批通过接口", notes="借款单报销推送NC报销审批通过接口")
    @RequestMapping(value = "/borrowMoneyBill", method = RequestMethod.POST)
    public Result borrowMoneyBill() {
        DelegateExecution delegateExecution=null;
        try {
            eaLoanbillExecutionListener.notify(delegateExecution);
        } catch (Exception e) {
            return Result.error(e.getMessage());
        }
        return  Result.ok("success");
    }
    /***
     * @Description: TODO
     * @author: CYS
     * @date: 2022/2/16 15:39
     * @param :
     * @Return: void
     */
    @AutoLog(value = "还款单报销推送NC报销审批通过接口")
    @ApiOperation(value="还款单报销推送NC报销审批通过接口", notes="还款单报销推送NC报销审批通过接口")
    @RequestMapping(value = "/repaymentBill", method = RequestMethod.POST)
    public Result repaymentBill() {
        DelegateExecution delegateExecution=null;
        try {
            eaRepaymentbillExecutionListener.notify(delegateExecution);
        } catch (Exception e) {
            return Result.error(e.getMessage());
        }
        return  Result.ok("success");
    }
}
